{% extends 'admin/reports_base.html' %}
{% load i18n adminmedia %}

{% block extrastyle %}
	{{ block.super }}
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css" type="text/css" />
{% endblock %}

{% block breadcrumbs %}
	<div class="breadcrumbs">
		<a href="/admin/">{% trans "Home" %}</a> &gt; 
		<a href="{% url admin_reports %}">Reports</a> &gt; 
		<a href="">Daily Activity</a>
	</div>
{% endblock %}

{% block report %}			
	<h1>Daily Customers Activity Report</h1>
	<p>Pick up another date: <input id="datepicker" type="text"></p>
	
	<div class="info_box">
		<div class="item"><div class="key">{% trans "Day" %}</div><div class="value">{{ day|date:"Y-m-d P" }}</div></div>
		<div class="item"><div class="key">{% trans "Month Init" %}</div><div class="value">{{ month_init|date:"Y-m-d P" }}</div></div>
		<div class="item"><div class="key">{% trans "Month End" %}</div><div class="value">{{ month_end|date:"Y-m-d P" }}</div></div>
	</div>
	
	<br></br>
	
	<div class="table">
		<div class="grid_20">
		{% for col_name in columns %}		
			<div class="th"><b>{{ col_name }}</b></div>
		{% endfor %}
		</div>
		<div class="clear"></div>		
		<hr></hr>
		{% for row in rows %}
		<div class="grid_20 margin_v">
			{% for col_value in row %}
    		<div class="td">{{ col_value }}</div>
			{% endfor %}		
		</div>
		<div class="clear"></div>
		{% endfor %}
		<hr></hr>
		<div class="grid_20 margin_v">
		{% for total in totals %}
			<div class="td"><b>{{ total }}</b></div>
		{% endfor %}
		</div>
		<div class="clear"></div>
	</div>
	
	<script type="text/javascript">
	$(document).ready(function(){
		$("#datepicker").datepicker({
		    dateFormat: 'yy-mm-dd',
			onSelect: function(dateText, inst) {
		   		window.location = "{% url admin_daily_activity %}" + "?date=" + dateText ;
		   		ShowProgressAnimation();
		   	}
		});		
	});
	</script>
{% endblock %}